package com.zhn.evsi.controller.Evsi;

import cn.hutool.core.util.ObjectUtil;
import com.zhn.evsi.common.Result;
import com.zhn.evsi.domain.dto.evsi.EvsiCharacterWalletJournalDTO;
import com.zhn.evsi.domain.dto.evsi.EvsiCharacterWalletTransactionsDTO;
import com.zhn.evsi.exception.CustomException;
import com.zhn.evsi.service.IEvsiCharacterWalletService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiOperationSupport;
import io.swagger.annotations.ApiSort;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@Api(tags = "钱包管理")
@ApiSort(value = 5)
@RestController
@RequestMapping("/Evsi/wallet")
public class EvsiCharacterWalletController {

    @Autowired
    private IEvsiCharacterWalletService characterWalletService;

    /**
     * 获取钱包余额
     * */
    @ApiOperation("获取钱包余额")
    @ApiOperationSupport(order = 1)
    @GetMapping("/wallet")
    public Result wallet() {
        Double wallet = characterWalletService.wallet();
        return Result.success(wallet);
    }

    /**
     * 获取钱包交易记录
     * */
    @ApiOperation("获取钱包交易记录")
    @ApiOperationSupport(order = 2)
    @GetMapping("/journal")
    public Result journal() {
        Map<String, Object> journal = characterWalletService.journal();
        return Result.success(journal);
    }

    /**
     * 钱包市场交易记录
     * */
    @ApiOperation("钱包市场交易记录")
    @ApiOperationSupport(order = 3)
    @GetMapping("/transactions")
    public Result transactions() {
        List<EvsiCharacterWalletTransactionsDTO> transactions = characterWalletService.transactions();
        return Result.success(transactions);
    }
}
